package com.yzt.minemodule.wallet;


import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.widget.TextView;

import com.yzt.minemodule.R;
import com.yzt.zhuju.mvp.MVPActivity;
import com.yzt.zhuju.network.entity.mine.wallet.WalletBean;
import com.yzt.zhuju.widget.tuiview.TUITextView;

/**
 * 作者：bobwang
 * 创建时间：2024-01-02 00:55:15
 * 描述：银行卡信息
 */
public class MineBankCardActivity extends MVPActivity {

    private TextView tv_card_status;
    private TextView tv_card_number;
    private TUITextView img_change;

    WalletBean extraId;

    public static void startSelf(Context activity, WalletBean extraId) {
        activity.startActivity(new Intent(activity, MineBankCardActivity.class)
                .putExtra("extra_id", extraId));
    }

    @Override
    public int getLayoutId() {
        return R.layout.activity_mine_bank_card;
    }

    @Override
    public void installViews() {
        mTitleBar.setTitle("我的银行卡");
        extraId = getIntent().getParcelableExtra("extra_id");
        tv_card_status = findViewById(R.id.tv_card_status);
        tv_card_number = findViewById(R.id.tv_card_number);
        img_change = findViewById(R.id.img_change);
        if (extraId.getBankCardNo() == null || extraId.getBankCardNo().equals("")) {
            img_change.setVisibility(View.GONE);
            tv_card_number.setText("");
            tv_card_status.setText("暂无储蓄卡");
        } else {
            tv_card_status.setText("储蓄卡");
            tv_card_number.setText("**** " + extraId.getBankCardNo().substring(extraId.getBankCardNo().length() - 4));
        }
        img_change.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                AddBankCardActivity.startSelf(MineBankCardActivity.this, "");
            }
        });
    }
}
